#ifndef _CINEMATICCAMERA_H_
#define _CINEMATICCAMERA_H_

#include "CGlobals.h"
#include "ISceneNodeAnimator.h"
#include <vector>

class CSceneObject;
class CCinematicThread;

class CCinematicCameraAnimator : public ISceneNodeAnimator
{
public:
	CCinematicCameraAnimator (ICameraSceneNode* camera);
	virtual ~CCinematicCameraAnimator();

	bool isEventReceiverEnabled () const;
	bool OnEvent (const SEvent& event);

	void animateNode (ISceneNode* node, u32 timeMs);
	void update(u32 timeMs);

	virtual ISceneNodeAnimator* createClone(ISceneNode* node,
				ISceneManager* newManager=0){ return 0; }

	void setCameraThread(CCinematicThread* thread);

	bool isFinished();
	

private:	

	ICameraSceneNode* m_camera;

	CCinematicThread* m_cameraThread;	

	std::vector<irr::core::vector3df> m_cameraPositions, m_cameraTargets;

	int m_lastTime;

	int m_currentTime;	

	void updateCamera(const irr::core::vector3df& pos, const irr::core::vector3df& target);

	bool m_bFinish;
};

#endif //_CINEMATICCAMERA_H_
